<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateHostPushLogTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('host_push_log', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('host_id')->default(0)->comment('主播ID');
            $table->unsignedInteger('receive_id')->default(0)->comment('接收用户ID');
            $table->unsignedTinyInteger('push_type')->default(0)->comment('推送类型');
            $table->unsignedTinyInteger('batch_no')->default(0)->comment('推送批次号');
            $table->unsignedTinyInteger('flag')->default(1)->comment('状态:1-已发送,0-发送失败');
            $table->timestamps();
            $table->index('host_id', 'host_id');
            $table->index('receive_id', 'receive_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('host_push_log');
    }
}
